﻿using DGZImp.ApsProject.DomainModels;
using DGZImp.BasProject.DomainModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace DGZImp.ApsProject.Dtos
{
    internal class Schedule
    {
    }

    public class ApsMoGroup
    {

        public long SalesOrderId { get; set; }
        public int Seq { get; set; }

        public DateTime? RequiredDate { get; set; }

        public decimal? TotalQty { get; set; }

        public List<ApsMo> Mos { get; set; }


        public long? SalesMaterialId { get; set; }
    }

    public class ApsMo : Aps_Mo
    {

        public decimal? TotalQty { get; set; }
        public long? SalesMaterialId { get; set; }
        public DateTime? RequiredDate { get; set; }
        public int? StepSequence { get; set; }
        public List<RountsDevices> Devices { get; set; }
        public List<MoAndPreMo> Mos { get; set; }

        public long? GroupId { get; set; }
        public long? RouteNameId { get; set; }

        public DateTime? WorkingStartTime { get; set; }

        public int? GroupSeq { get; set; }
        public int? MoSeq { get; set; }

        public int? IsNew { get; set; }

        public int? IsCe { get; set; }


    }

    public class MoAndPreMo
    {
        public string MoCode { get; set; }
        public string PreMoCode { get; set; }
    }

    public class RountsDevices
    {

        public string ProductStuffix { get; set; }
        public long? RouteNameId { get; set; }
        public long? RouteControlId { get; set; }
        public long? MachineId { get; set; }
        public decimal? Uph { get; set; }
        public decimal? OutputCircle { get; set; }
        public decimal? PreparationMinutes { get; set; }
        public decimal? BeforeMinutes { get; set; }
        public decimal? afterMinutes { get; set; }
        public long? GroupId { get; set; }
        public long? MaterialId { get; set; }

        public int? StepSequence { get; set; }

        public long? RouteDeviceId { get; set; }

        public bool Enable { get; set; } = true;


        public DateTime WorkingEndTime { get; set; }

        public int? MachineLevel { get; set; }

        /// <summary>
        /// 位置
        /// </summary>
        public int? PositionRow { get; set; }

        /// <summary>
        /// 关联设备
        /// </summary>
        public long? RelatedDevice { get; set; }

        /// <summary>
        /// 是否含ce
        /// </summary>
        public int? IsCe { get; set; }
    }


    public class ResFirstCulationDto
    {
        /// <summary>
        /// 排程任务
        /// </summary>
        public List<Aps_ScheduleTask> reqTask { get; set; }

        /// <summary>
        /// 排程时间
        /// </summary>
        public List<Aps_ScheduleTaskDate> reqDate { get; set; }
    }

    public class DetailShift : Aps_ShiftDetail
    {
        public DateTime WorkDate { get; set; }
    }
    public class ResCulationLineTimeDto
    {
        /// <summary>
        /// 排程时间
        /// </summary>
        public List<Aps_ScheduleTaskDate> taskDates { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime beginTime { get; set; }

        /// <summary>
        /// 标识能否排完--标识行事历不够导致的没有排完
        /// </summary>
        public int? IsClendarFinish { get; set; }

        /// <summary>
        /// 多设备情况
        /// </summary>
        public decimal? Surplus { get; set; }
    }
    public class curMachines
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public long? MachineId { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }

        public decimal? Uph { get; set; }


    }


    public class SeqMoDto
    {
        public string MoCode { get; set; }

        public string PreMoCode { get; set; }

        public DateTime? WorkingStartTime { get; set; }

        public Decimal? OutputCircle { get; set; }

    }


    public class MachineBeginTimeDto
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public long MachineId { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime BeginTime { get; set; }

        /// <summary>
        /// 可用
        /// </summary>
        public bool Usable { get; set; } = true;

        /// <summary>
        /// 产品
        /// </summary>
        public string ProductsCode { get; set; }


        public int DeviceSeq { get; set; } = 0;
    }

    public class ReqHandSchedule
    {
        public List<ReqHandScheduleItem> MoList { get; set; }

        public List<long> GroupIds { get; set; }
    }

    public class ReqHandDeviceSchedule
    {
        public List<Aps_ScheduleTask> TaskList { get; set; }

    }



    public class ReqHandScheduleItem
    {
        public string MoCode { get; set; }


        public long SalesOrderId { get; set; }


        public long SalesMaterialId { get; set; }

    }


    public class ShiftCachesDto : Aps_MachineShift
    {
        public decimal Qty { get; set; }

        public decimal QtyCost { get; set; }

        public decimal Hours { get; set; }
        public decimal Surplus { get; set; }

    }


}
